//
//  UIView+STTools_moreex.h
//  STRich
//
//  Created by stoneobs on 2017/3/7.
//  Copyright © 2017年 stoneobs. All rights reserved.
//

#import <UIKit/UIKit.h>

typedef NS_ENUM(NSUInteger, STAnimationType_stoneobs_enum) {
    STAnimationTypekCATransitionPush_stoneobs_enum,//推入
    STAnimationTypekCATransitionMoveIn_stoneobs_enum,//移入
    STAnimationTypekCATransitionReveal_stoneobs_enum,//揭开效果
    STAnimationTypekCATransitionFade_stoneobs_enum,//渐入渐出效果
    STAnimationTypecube_stoneobs_enum,//立方体效果
    STAnimationTypesuckEffect_stoneobs_enum,//吮吸 效果
    STAnimationTyperippleEffect_stoneobs_enum,//水波抖动效果
    STAnimationTypeSTpageCurle_stoneobs_enum,// 翻页
    STAnimationTypeSTpageUnCurl_stoneobs_enum,//反翻页
    STAnimationTypeoglFlip_stoneobs_enum,//上下翻转
    STAnimationTypecameraIrisHollowOpen_stoneobs_enum,//镜头打开
    STAnimationTypecameraIrisHollowClose_stoneobs_enum,//镜头关闭
    STAnimationTypeCurlDown_stoneobs_enum,//下翻页
    STAnimationTypeCurlUp_stoneobs_enum,//上翻页
    STAnimationTypeFlipFromLeft_stoneobs_enum,//左翻转
    STAnimationTypeFlipFromRight_stoneobs_enum,//右翻转
};

@interface UIView (STTools_moreex)

- (void)stoneobs_fun_st_showAnimationWithType:(STAnimationType_stoneobs_enum)type;

- (void)stoneobs_fun_st_showAnimationWithType:(STAnimationType_stoneobs_enum)type duration:(CFTimeInterval) duration;
- (void)stoneobs_fun_st_showCircleRoundAnimationWithKey:(NSString*)key;

//展示菊花
- (void)stoneobs_fun_st_showActivityViewWithStyle:(UIActivityIndicatorViewStyle)style;
//隐藏菊花
- (void)stoneobs_fun_st_hideActivityView;


//
- (nullable UIImage *)stoneobs_fun_stoneobs_fun_st_snapshotImage;
- (nullable UIImage *)stoneobs_fun_stoneobs_fun_st_snapshotImageAfterScreenUpdates:(BOOL)afterUpdates;
- (nullable NSData *)stoneobs_fun_snapshotPDF;
- (void)setLayerShadow:(nullable UIColor*)color offset:(CGSize)offset radius:(CGFloat)radius;
- (void)removeAllSubviews;
@property (nullable, nonatomic, readonly) UIViewController *viewController;
@property (nonatomic) CGFloat left;        ///< Shortcut for frame.origin.x.
@property (nonatomic) CGFloat top;         ///< Shortcut for frame.origin.y
@property (nonatomic) CGFloat right;       ///< Shortcut for frame.origin.x + frame.size.width
@property (nonatomic) CGFloat bottom;      ///< Shortcut for frame.origin.y + frame.size.height
@property (nonatomic) CGFloat width;       ///< Shortcut for frame.size.width.
@property (nonatomic) CGFloat height;      ///< Shortcut for frame.size.height.
@property (nonatomic) CGFloat centerX;     ///< Shortcut for center.x
@property (nonatomic) CGFloat centerY;     ///< Shortcut for center.y
@property (nonatomic) CGPoint origin;      ///< Shortcut for frame.origin.
@property (nonatomic) CGSize  size;        ///< Shortcut for frame.size.

@property (nonatomic) CGFloat st_left;
@property (nonatomic) CGFloat st_top;
@property (nonatomic) CGFloat st_right;
@property (nonatomic) CGFloat st_bottom;
@property (nonatomic) CGFloat st_width;
@property (nonatomic) CGFloat st_height;
@property (nonatomic) CGPoint st_origin;
@property (nonatomic) CGSize  st_size;
@property (nonatomic) CGFloat st_centerX;
@property (nonatomic) CGFloat st_centerY;


#pragma mark --shadow

//展示4种阴影
- (void)stoneobs_fun_stoneobs_fun_st_showTopShadow;
- (void)stoneobs_fun_stoneobs_fun_st_showBottomShadow;
- (void)stoneobs_fun_stoneobs_fun_st_showLeftShadow;
- (void)stoneobs_fun_stoneobs_fun_st_showRightShadow;
- (void)stoneobs_fun_stoneobs_fun_st_showRightAndBottomShadow;
//展示各种线条
- (void)stoneobs_fun_stoneobs_fun_st_showRightLine:(CGFloat)height;
- (void)stoneobs_fun_stoneobs_fun_st_showRightInsetLine:(CGFloat)height insetx:(CGFloat)insetx;
- (void)stoneobs_fun_stoneobs_fun_st_showLeftLine:(CGFloat)height;
- (void)stoneobs_fun_stoneobs_fun_st_showBottomLine;
- (void)stoneobs_fun_stoneobs_fun_st_showBottomLineAndWitdh:(CGFloat)witdh;
- (void)stoneobs_fun_stoneobs_fun_st_showTopLine;

//展示周围的layer 到父view
- (CALayer*)stoneobs_fun_stoneobs_fun_st_showRoundLayer;
- (CALayer*)stoneobs_fun_stoneobs_fun_st_showRoundLayerWithColor:(UIColor*)color;
//展示边框 一般0.3 黑色
- (void)stoneobs_fun_stoneobs_fun_st_setBrderWidth:(CGFloat)width
             borderColor:(UIColor*)borderColor;
//展示虚线边框 如果frame 改变 则需要重新设置
- (void)stoneobs_fun_stoneobs_fun_st_setDottedLineBrderWidth:(CGFloat)width
                       borderColor:(UIColor*)borderColor;

- (void)stoneobs_fun_stoneobs_fun_st_setBorderWith:(CGFloat)width
             borderColor:(UIColor *)borderColor
            cornerRadius:(CGFloat)radius;
@end

